package com.woniuxy.service.impl;

import com.woniuxy.dao.StuDao;
import com.woniuxy.dao.impl.StuDaoImpl;
import com.woniuxy.entity.Stu;
import com.woniuxy.service.StuService;

import java.util.List;

/**
 * @author 作者
 * @create 2025-11-19 14:54
 */
public class StuServiceImpl implements StuService {

    //业务逻辑层调用数据访问层
    StuDao stuDao=new StuDaoImpl();

    @Override
    public void add(Stu stu) throws Exception {
        stuDao.insert(stu);
    }

    @Override
    public void modify(Stu stu) throws Exception {
        stuDao.update(stu);
    }

    @Override
    public void removeBySid(int sid) throws Exception {
        stuDao.deleteBySid(sid);
    }

    @Override
    public List<Stu> getAll() throws Exception {
        return stuDao.selectAll();
    }
}
